package org.carabiner.infopanel;

import java.awt.Component;
import java.util.List;

import javax.swing.Icon;

/**
 * A Rule is a strategy that can be used to check the state of an instantiated
 * component or frame. <p/>
 * 
 * Two rules are equal (in the sense of the equals() method) if their names are
 * equal.
 * 
 * @author Ben Rady (benrady@gmail.com)
 * 
 */
public interface Rule
{
  /**
   * Returns a unique, user presentable name for this rule
   * 
   * @return String
   */
  String getName();

  String getDescription();

  /**
   * 16x16 Icon used when displaying the rule in a list or tree
   * 
   * @return Icon
   */
  Icon getIcon();

  // ///////////////////////////////////////////////////////////////////////////
  // Inspection methods
  // ///////////////////////////////////////////////////////////////////////////

  /**
   * Inspects a object (usually a component) and all of it children (if any).
   * This method returns a list of {@link Warning warnings} about the component
   * and it's subcomponents.
   * 
   * @param component
   *          Component
   * @return Map map of component<->warning pairs that holds all of the
   *         warnings
   */
  List inspect(Component component);
}
